// 封装与文章相关的API请求
import { request } from "@/utils"

// 1、获取频道列表数据
export const getChannelsAPI = () => {
  return request.get('/channels')
}

// 2、新增文章类别
export const addArticleClassAPI = (data) => {
  return request.post('/mp/articles?draft=false',data)
}

// 3、获取文章列表
export const getChannelListAPI = (data) => {
  return request.get('mp/articles',{
    params:{
      data
    }
  })
}

// 4、删除文章
export const delArticleAPI = (id) => {
  return request.delete(`/mp/articles/${id}`)
}


// 5、获取文章详细信息
export const getArticleInfoByIdAPI = (id) => {
  return request.get(`/mp/articles/${id}`)
}

// 6、编辑更新文章
export const updateArticleAPI = (data) => {
  return request.put(`/mp/articles/${data.id}`,data)
}